<html>
<head><meta charset="utf-8"><title>asm goto · project-inline-asm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/index.html">project-inline-asm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/asm.20goto.html">asm goto</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="230129169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/asm%20goto/near/230129169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/asm.20goto.html#230129169">(Mar 13 2021 at 02:48)</a>:</h4>
<p>The <a href="https://rust-lang.github.io/rfcs/2873-inline-asm.html">RFC</a> has a section about labels / code pointers in <code>asm!</code>, with the syntax:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="fm">asm!</span><span class="p">(</span><span class="w"></span>
<span class="w">    </span><span class="s">"jmp {}"</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">label</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="fm">println!</span><span class="p">(</span><span class="s">"a"</span><span class="p">);</span><span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="p">);</span><span class="w"></span>
</code></pre></div>
<p>However <code>label</code> does not appear to be supported in the macro currently. Does this or any equivalent functionality exist? (Non-<code>asm!</code> options are okay too; I want to stick a label on a block of code and put the address in a variable, to implement a <code>setjmp</code> like function.)</p>



<a name="230129618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/asm%20goto/near/230129618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/asm.20goto.html#230129618">(Mar 13 2021 at 02:56)</a>:</h4>
<p>(oops, I missed that the section about <code>asm goto</code> is under "Future possibilities")</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>